#include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>
#include <vector>
#include <iterator>

using namespace std;

#include "StringUtils.h"


vector<double> StringUtils::getCoords(string &str) {
  vector<double> elems;
  vector<string> tokens;
  istringstream iss(str);
  copy(istream_iterator<string>(iss),
    istream_iterator<string>(),
    back_inserter<vector<string> >(tokens));

  for (unsigned i = 0; i < tokens.size(); i++)
    elems.push_back(atof(tokens [i].c_str()));

  return elems;
}
